<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="s_firm" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 仓库布列表 </span>
      </div>
      <el-table :data="s_firm">
        <el-table-column label="操作" align="center" width='100' type=''>
          <template slot-scope="scope">
            <el-dropdown trigger="click">
              <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>
                  <el-link @click="gotoPage('/psi/supplychainmana/LayoutViewDetTest?CMID='+scope.row.firm_id+''+vueparams+'')">设置</el-link>
                </el-dropdown-item>
                <el-dropdown-item>
                  <el-link @click="popWarehouseUp('&CMID='+scope.row.firm_id+'')">修改</el-link>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
        <el-table-column label="仓库" prop="firm_id">
          <template slot-scope="scope">
            <el-link @click="gotoPage('/psi/supplychainmana/LayoutViewDetTest?CMID='+scope.row.firm_id+''+vueparams+'')" type='primary'>{{scope.row.full_name}}</el-link>
          </template>
        </el-table-column>
        <el-table-column label="库管组长" prop="rcontact_name">
        </el-table-column>
        <el-table-column label="仓库位置" prop="area_position">
        </el-table-column>
        <el-table-column label="设置时间" prop="entered">
          <template slot-scope="scope">
            {{getDateTimeString(scope.row,'entered')}}
          </template>
        </el-table-column>
        <el-table-column label="设置人" prop="vcontact_name">
        </el-table-column>
        <el-table-column label="状态" prop="hours_state">
          <template slot-scope="scope">
            {{getValueName("未设置=0,已设置=1",scope.row.hours_state)}}
          </template>
        </el-table-column>
      </el-table>
    </el-form>
    <el-dialog :visible.sync="WarehouseUpVisible" append-to-body>
      <WarehouseUp v-if="WarehouseUpVisible" ref="WarehouseUp" :popparams="popparams"> </WarehouseUp>
    </el-dialog>
  </div>
</template>
<script>
  import request from '@/utils/request'
  import WarehouseUp from "@/views/psi/supplychainmana/WarehouseUp";
  export default {
    name: 'WarehouseSet',
    components: {
      WarehouseUp,
    },
    props: ['popparams'],
    data() {
      return {
        WarehouseUpVisible: false,
        WarehouseUpValue: null,
        WarehouseUpDesc: null,
        vueparams: this.getVUEParams(""),
        s_firm: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/supplychainmana/WarehouseAction/warehouseSet?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      popWarehouseUp(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.WarehouseUpVisible = !this.WarehouseUpVisible;
      },
    },
  }
</script>
